<!DOCTYPE html>
<html itemscope="" itemtype="http://schema.org/QAPage"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <title>Drawing a filled rectangle with a border in android - Stack Overflow</title>
    <link rel="shortcut icon" href="http://cdn.sstatic.net/stackoverflow/img/favicon.ico?v=6cd6089ee7f6">
    <link rel="apple-touch-icon image_src" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png?v=41f6e13ade69">
    <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://stackoverflow.com/opensearch.xml">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:domain" content="stackoverflow.com">
    <meta property="og:type" content="website">
    <meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon@2.png?v=ea71a5211a91">
    <meta name="twitter:title" property="og:title" itemprop="title name" content="Drawing a filled rectangle with a border in android">
    <meta name="twitter:description" property="og:description" itemprop="description" content="Is there any way in Android to draw a filled rectangle with say a black border. My problem is that the canvas.draw() takes one paint object, and to my knowledge the paint object can't have a differ...">
    <meta property="og:url" content="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android">
    <link rel="canonical" href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android">

    
    
    <script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/ados" async="" type="text/javascript"></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/quant.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/beacon.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/analytics.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/ados.js" async="" type="text/javascript"></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/jquery.js"></script>
    <script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/stub.js"></script>
    <link rel="stylesheet" type="text/css" href="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/all.css">
    
    <link rel="alternate" type="application/atom+xml" title="Feed for question 'Drawing a filled rectangle with a border in android'" href="http://stackoverflow.com/feeds/question/13545792">
    <meta name="twitter:app:country" content="US">
    <meta name="twitter:app:name:iphone" content="Stack Exchange iOS">
    <meta name="twitter:app:id:iphone" content="871299723">
    <meta name="twitter:app:url:iphone" content="se-zaphod://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android">
    <meta name="twitter:app:name:ipad" content="Stack Exchange iOS">
    <meta name="twitter:app:id:ipad" content="871299723">
    <meta name="twitter:app:url:ipad" content="se-zaphod://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android">
    <meta name="twitter:app:name:googleplay" content="Stack Exchange Android">
    <meta name="twitter:app:url:googleplay" content="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android">
    <meta name="twitter:app:id:googleplay" content="com.stackexchange.marvin">
    <script>
        
        StackExchange.ready(function () {
                
                StackExchange.using("snippets", function () {
                    StackExchange.snippets.initSnippetRenderer();
                });
                

            StackExchange.using("postValidation", function () {
                StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');
            });

            
            StackExchange.question.init({showAnswerHelp:true,totalCommentCount:1,shownCommentCount:1,highlightColor:'#F4A83D',backgroundColor:'#FFF',questionId:13545792});

            styleCode();

                StackExchange.realtime.subscribeToQuestion('1', '13545792');
                                    
        });
    </script>


    <script>
        StackExchange.init({"locale":"en","stackAuthUrl":"https://stackauth.com","serverTime":1426176194,"networkMetaHostname":"meta.stackexchange.com","routeName":"Questions/Show","styleCode":true,"enableUserHovercards":true,"snippets":{"enabled":true,"domain":"stacksnippets.net"},"site":{"name":"Stack Overflow","description":"Q&A for professional and enthusiast programmers","isNoticesTabEnabled":true,"recaptchaPublicKey":"6LdchgIAAAAAAJwGpIzRQSOFaO0pU6s44Xt8aTwc","recaptchaAudioLang":"en","enableNewTagCreationWarning":true,"insertSpaceAfterNameTabCompletion":false,"nonAsciiTags":true,"enableSocialMediaInSharePopup":true},"user":{"fkey":"7d79d500f57d16c8348b0cafce12f3e4","isAnonymous":true}});
        StackExchange.using.setCacheBreakers({"js/prettify-full.en.js":"b175eb924d57","js/moderator.en.js":"9be321ee4fdc","js/full-anon.en.js":"6db2cae40593","js/full.en.js":"8d494d746c62","js/wmd.en.js":"e3cea4ddb176","js/third-party/jquery.autocomplete.min.js":"e5f01e97f7c3","js/third-party/jquery.autocomplete.min.en.js":"","js/mobile.en.js":"0c842be285f8","js/help.en.js":"1ad0e1555080","js/tageditor.en.js":"cce06892ec76","js/tageditornew.en.js":"826ad849aac1","js/inline-tag-editing.en.js":"1498d8619942","js/revisions.en.js":"989c474e85a9","js/review.en.js":"bfd78f82de6e","js/tagsuggestions.en.js":"b278f9a0b23b","js/post-validation.en.js":"5f888917f392","js/explore-qlist.en.js":"257ba4cb7b04","js/events.en.js":"2fa54a1ec36c","js/keyboard-shortcuts.en.js":"a6f850dce3f7","js/external-editor.en.js":"a9a74e04c9b0","js/external-editor.en.js":"a9a74e04c9b0","js/snippet-javascript.en.js":"7700e8b17c10","js/snippet-javascript-codemirror.en.js":"9275259d10ab"});
        StackExchange.using("gps", function() {
             StackExchange.gps.init(true);
        });
    </script>
    
        <script>
            StackExchange.ready(function () {
                $('#nav-tour').click(function () {
                    StackExchange.using("gps", function() {
                        StackExchange.gps.track("aboutpage.click", { aboutclick_location: "headermain" }, true);
                    });
                });
            });
        </script>
    
    
<script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/full-anon.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/snippet-javascript.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/post-validation.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/prettify-full.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/external-editor.js" async=""></script><script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/adFeedback.js" type="text/javascript"></script><link href="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/adFeedback.css" rel="stylesheet"><script>try {  for(var lastpass_iter=0; lastpass_iter < document.forms.length; lastpass_iter++){    var lastpass_f = document.forms[lastpass_iter];    if(typeof(lastpass_f.lpsubmitorig)=="undefined"){      if (typeof(lastpass_f.submit) == "function") {        lastpass_f.lpsubmitorig = lastpass_f.submit;        lastpass_f.submit = function(){          var form = this;          try {            if (document.documentElement && 'createEvent' in document)            {              var forms = document.getElementsByTagName('form');              for (var i=0 ; i<forms.length ; ++i)                if (forms[i]==form)                {                  var element = document.createElement('lpformsubmitdataelement');                  element.setAttribute('formnum',i);                  element.setAttribute('from','submithook');                  document.documentElement.appendChild(element);                  var evt = document.createEvent('Events');                  evt.initEvent('lpformsubmit',true,false);                  element.dispatchEvent(evt);                  break;                }            }          } catch (e) {}          try {            form.lpsubmitorig();          } catch (e) {}        }      }    }  }} catch (e) {}</script><link href="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/jobs.css" rel="stylesheet" type="text/css"></head>
<body class="question-page new-topbar">
    <noscript><div id="noscript-padding"></div></noscript>
    <div id="notify-container"></div>
    <div id="overlay-header"></div>
    <div id="custom-header"></div>




<div class="topbar">
    <div class="topbar-wrapper">

        <div class="js-topbar-dialog-corral">

<div class="topbar-dialog siteSwitcher-dialog dno">
    <div class="header">
        <h3><a href="http://stackoverflow.com/">current community</a></h3>
    </div>
    <div class="modal-content current-site-container">
        <ul class="current-site">
                <li>
                        <div class="related-links">
            <a href="http://chat.stackoverflow.com/" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:6 })">chat</a>
                    <a href="http://blog.stackoverflow.com/" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:7 })">blog</a>
            </div>




    <a href="http://stackoverflow.com/" class="current-site-link site-link js-gps-track" data-id="1" data-gps-track="
        site_switcher.click({ item_type:3 })">
        <div class="site-icon favicon favicon-stackoverflow" title="Stack Overflow"></div>
        Stack Overflow
    </a>

                </li>
                <li class="related-site">
                        <div class="L-shaped-icon-container">
        <span class="L-shaped-icon"></span>
    </div>

                    



    <a href="http://meta.stackoverflow.com/" class="site-link js-gps-track" data-id="552" data-gps-track="
            site.switch({ target_site:552, item_type:3 }),
        site_switcher.click({ item_type:4 })">
        <div class="site-icon favicon favicon-stackoverflowmeta" title="Meta Stack Overflow"></div>
        Meta Stack Overflow
    </a>

                </li>
                            <li class="related-site">
                        <div class="L-shaped-icon-container">
        <span class="L-shaped-icon"></span>
    </div>

                    <a class="site-link js-gps-track" href="http://careers.stackoverflow.com/?utm_source=stackoverflow.com&amp;utm_medium=site-ui&amp;utm_campaign=multicollider" data-gps-track="site_switcher.click({ item_type:9 })">
                        <div class="site-icon favicon favicon-careers" title="Stack Overflow Careers"></div>
                        Stack Overflow Careers
                    </a>
                </li>
        </ul>
    </div>
    
    <div class="header" id="your-communities-header">
        <h3>
your communities        </h3>
            
    </div>
    <div class="modal-content" id="your-communities-section">
            
            <div class="call-to-login">
<a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android" class="login-link js-gps-track" data-gps-track="site_switcher.click({ item_type:10 })">Sign up</a> or <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android" class="login-link js-gps-track" data-gps-track="site_switcher.click({ item_type:11 })">log in</a> to customize your list.
            </div>
    </div>
    
    <div class="header">
        <h3><a href="http://stackexchange.com/sites">more stack exchange communities</a></h3>
    </div>
    <div class="modal-content">
            <div class="child-content"></div>
    </div>
</div>
        </div>

        <div class="network-items">

            <a href="http://stackexchange.com/" class="topbar-icon icon-site-switcher yes-hover js-site-switcher-button js-gps-track" data-gps-track="site_switcher.show" title="A list of all 138 Stack Exchange sites">
                <span class="hidden-text">Stack Exchange</span>
            </a>

        </div>

        <div class="topbar-links">

                <div class="links-container">
                <span class="topbar-menu-links">
                                <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android" class="login-link">sign up</a>
                                <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android" class="login-link">log in</a>

                        <a href="http://stackoverflow.com/tour">tour</a>
                            <a href="#" class="icon-help js-help-button" title="Help Center and other resources">
        help
        <span class="triangle"></span>
    </a>
    <div class="topbar-dialog help-dialog js-help-dialog dno">
        <div class="modal-content">
            <ul>
                                    <li>
                        <a href="http://stackoverflow.com/tour" class="js-gps-track" data-gps-track="help_popup.click({ item_type:1 })">
                            Tour
                            <span class="item-summary">
                                Start here for a quick overview of the site
                            </span>
                        </a>
                    </li>
                <li>
                    <a href="http://stackoverflow.com/help" class="js-gps-track" data-gps-track="help_popup.click({ item_type:4 })">
                        Help Center
                        <span class="item-summary">
                            Detailed answers to any questions you might have
                        </span>
                    </a>
                </li>
                    <li>
                        <a href="http://meta.stackoverflow.com/" class="js-gps-track" data-gps-track="help_popup.click({ item_type:2 })">
                            Meta
                            <span class="item-summary">
                                Discuss the workings and policies of this site
                            </span>
                        </a>
                    </li>
            </ul>
        </div>
    </div>

                            <a href="http://careers.stackoverflow.com/?utm_source=stackoverflow.com&amp;utm_medium=site-ui&amp;utm_campaign=anon-topbar">stack overflow careers</a>
                    </span>
                </div>

            <div class="search-container">
                <form id="search" action="/search" method="get" autocomplete="off">
                    <input name="q" placeholder="search" tabindex="1" autocomplete="off" maxlength="240" type="text">
                </form>
            </div>

        </div>
    </div>
</div>
    <script>
        StackExchange.ready(function() { StackExchange.topbar.init(); });
    </script>

    <div class="container">
        <div id="header">
            <br class="cbt">
            <div id="hlogo">
                <a href="http://stackoverflow.com/">
                    Stack Overflow
                </a>
            </div>
            <div id="hmenus">
                <div class="nav mainnavs">
                    <ul>
                        <li class="youarehere"><a id="nav-questions" href="http://stackoverflow.com/questions">Questions</a></li>
                        <li><a id="nav-tags" href="http://stackoverflow.com/tags">Tags</a></li>
                        <li><a id="nav-users" href="http://stackoverflow.com/users">Users</a></li>
                        <li><a id="nav-badges" href="http://stackoverflow.com/help/badges">Badges</a></li>
                        <li><a id="nav-unanswered" href="http://stackoverflow.com/unanswered">Unanswered</a></li>
                    </ul>
                </div>
                <div class="nav askquestion">
                    <ul>
                        <li>
                            <a id="nav-askquestion" href="http://stackoverflow.com/questions/ask">Ask Question</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        



        <div id="content" class="snippet-hidden">
            

<div itemscope="" itemtype="http://schema.org/Question">
	<link itemprop="image" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
			<!--googleoff: all-->

<div id="herobox-mini">
    <div id="hero-content">
        <span id="controls">
            <a href="http://stackoverflow.com/tour" id="tell-me-more" class="button">Take the 2-minute tour</a>
            <span id="close"><a title="click to dismiss">×</a></span>
        </span>
        <div id="blurb">
            Stack Overflow is a question and answer site for 
professional and enthusiast programmers. It's 100% free, no registration
 required.
        </div>        
    </div>
    <script>
        $('#tell-me-more').click(function () {
            var clickSource = $("body").attr("class") + '-mini';
            if ($("body").hasClass("questions-page")) {
                clickSource = 'questionpagemini';
            } else if ($("body").hasClass("question-page")) {
                clickSource = 'questionpagemini';
            } else if ($("body").hasClass("home-page")) {
                clickSource = 'homepagemini';
            }

            StackExchange.using("gps", function () {
                StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource } , true);
            });
        });
        $('#herobox-mini #close').click(function () {
            StackExchange.using("gps", function () {
                StackExchange.gps.track("hero.action", { hero_action_type: "close" }, true);
            });
            $.cookie("hero", "none", { path: "/", expires: 365 });
            var $hero = $("#herobox-mini");
            $hero.slideUp('fast', function () { $hero.remove(); });
            return false;
        });
    </script>
</div>
			<!--googleon: all-->
			<div id="question-header">
			<h1 itemprop="name"><a href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android" class="question-hyperlink">Drawing a filled rectangle with a border in android</a></h1>
		</div>
			<div id="mainbar">

			

<div class="question" data-questionid="13545792" id="question">

    <script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk720038130",4).setZone(43) ; });                    
            </script>
            <div class="everyonelovesstackoverflow adzerk-vote" id="adzerk720038130"><a href="http://engine.adzerk.net/r?e=eyJhdiI6NDk2LCJhdCI6NCwiYnQiOjAsImNtIjoyMDAzNTgsImNoIjoxMTc4LCJjciI6NzY4MTA2LCJkaSI6IjAxODI5YjE4MjJjYTQ2Nzg5MDc0NzZlNjEyZmY4ZjkyIiwiZG0iOjEsImZjIjo3OTk5NzIsImZsIjo0NDIwNzksImlwIjoiMTQuMTY5LjQ0LjEiLCJrdyI6ImFuZHJvaWQsYm9yZGVyLGFuZHJvaWQtY2FudmFzLHBhaW50LGZpbGwiLCJtayI6ImFuZHJvaWQiLCJudyI6MjIsInBjIjo3LjEzLCJwciI6NzY1LCJydCI6MiwicmYiOiJodHRwOi8vd3d3Lmdvb2dsZS5jb20vdXJsP3NhPXQmcmN0PWomcT0mZXNyYz1zJnNvdXJjZT13ZWImY2Q9MiZ2ZWQ9MENDVVFGakFCJnVybD1odHRwOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzEzNTQ1NzkyL2RyYXdpbmctYS1maWxsZWQtcmVjdGFuZ2xlLXdpdGgtYS1ib3JkZXItaW4tYW5kcm9pZCZlaT13TGdCVmVqbUVNejU4UVg2Nm9Eb0RnJnVzZz1BRlFqQ05IcVl6RVB5NzJ3ZW1lclZEUnU1bzU3dkdvT2FBJmJ2bT1idi44NzkyMDcyNixkLmRHYyZjYWQ9cmphIiwic3QiOjgyNzcsInVrIjoidWUxLTQzNGFlNmQyZmZkYjQ0OTNiZDZlNTM1ZDhjZmU4ODEwIiwiem4iOjQzLCJ0cyI6MTQyNjE3NjE5NzQ4NiwiYmYiOnRydWUsInBuIjoiYWR6ZXJrNzIwMDM4MTMwIiwidXIiOiJodHRwczovL3d3dy5oaXBjaGF0LmNvbS8_dXRtX3NvdXJjZT1zdGFja292ZXJmbG93JnV0bV9tZWRpdW09ZGlzcGxheSZ1dG1fY2FtcGFpZ249aGlwY2hhdCZ1dG1fY29udGVudD1sZXNzLWVtYWlsLWFfZW5fNzI4eDkwIn0&amp;s=LagRafYAoya96vwumr73vW9upCY" rel="nofollow" target="_blank" title=""><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/06d16d11d9994014bc180d167661c7df.jpg" title="" alt="" border="0" height="90" width="728"></a><div class="adzerk-vote-controls" style="display: none;"><div class="adzerk-vote-option adzerk-vote-up"><div class="adzerk-vote-icon"></div></div><div class="adzerk-vote-option adzerk-vote-down"><div class="adzerk-vote-icon"></div></div></div><div class="adzerk-vote-survey" style="display:none;"><form><span>No problem. We won't show you that ad again. Why didn't you like it?</span><ul><li><label><input value="12" name="downvoteReason" type="radio">Uninteresting</label></li><li><label><input value="13" name="downvoteReason" type="radio">Misleading</label></li><li><label><input value="14" name="downvoteReason" type="radio">Offensive</label></li><li><label><input value="15" name="downvoteReason" type="radio">Repetitive</label></li><li><label><input value="16" name="downvoteReason" type="radio">Other</label></li></ul><a href="#" class="adzerk-vote-cancel">Oops! I didn't mean to do this.</a></form></div><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/i_003.gif" style="position:absolute;" border="0" height="0px" width="0px"></div>    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input name="_id_" value="13545792" type="hidden">
    <a class="vote-up-off" title="This question shows research effort; it is useful and clear">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">3</span>
    <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful">down vote</a>
    
    <a class="star-off" href="#" title="This is a favorite question (click again to undo)">favorite</a>
    <div class="favoritecount"><b>2</b></div>   

</div>

            </td>
            
<td class="postcell">
<div>
    <div class="post-text" itemprop="text">

        <p>Is there any way in Android to draw a filled rectangle with 
say a black border. My problem is that the canvas.draw() takes one paint
 object, and to my knowledge the paint object can't have a different 
color for the fill and the stroke. Is there a way around this?</p>

    </div>
    <div class="post-taglist">
        <a href="http://stackoverflow.com/questions/tagged/android" class="post-tag js-gps-track" title="show questions tagged 'android'" rel="tag"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/tKsDb.png" alt="" class="sponsor-tag-img" height="16" width="18">android</a> <a href="http://stackoverflow.com/questions/tagged/border" class="post-tag js-gps-track" title="show questions tagged 'border'" rel="tag">border</a> <a href="http://stackoverflow.com/questions/tagged/android-canvas" class="post-tag js-gps-track" title="" rel="tag">android-canvas</a> <a href="http://stackoverflow.com/questions/tagged/paint" class="post-tag js-gps-track" title="show questions tagged 'paint'" rel="tag">paint</a> <a href="http://stackoverflow.com/questions/tagged/fill" class="post-tag js-gps-track" title="show questions tagged 'fill'" rel="tag">fill</a> 
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/q/13545792" title="short permalink to this question" class="short-link" id="link-post-13545792">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/13545792/edit" class="suggest-edit-post" title="">improve this question</a></div>        
    </td>
    <td class="post-signature" align="right">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="http://stackoverflow.com/posts/13545792/revisions" title="show all edits to this post">edited <span title="2012-11-25 16:07:25Z" class="relativetime">Nov 25 '12 at 16:07</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/322395/loktar"><div class="gravatar-wrapper-32"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/ToSp3.png" alt="" height="32" width="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/322395/loktar">Loktar</a><br>
        <span class="reputation-score" title="reputation score 19008" dir="ltr">19k</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="37 silver badges"><span class="badge2"></span><span class="badgecount">37</span></span><span title="65 bronze badges"><span class="badge3"></span><span class="badgecount">65</span></span>
    </div>
</div>    </td>
    <td class="post-signature owner">
        <div class="user-info ">
    <div class="user-action-time">
        asked <span title="2012-11-24 21:28:47Z" class="relativetime">Nov 24 '12 at 21:28</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/1112091/uwais-iqbal"><div class="gravatar-wrapper-32"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/d13249b91b5299cbd39d9d90f228f155.png" alt="" height="32" width="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/1112091/uwais-iqbal">Uwais Iqbal</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">55</span><span title="1 gold badge"><span class="badge1"></span><span class="badgecount">1</span></span><span title="1 silver badge"><span class="badge2"></span><span class="badgecount">1</span></span><span title="8 bronze badges"><span class="badge3"></span><span class="badgecount">8</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</div>
</td>
        </tr>
                
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-13545792" class="comments ">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">



    <tr id="comment-18551804" class="comment ">
        <td>
            <table>
                <tbody>
                    <tr>
                        <td class=" comment-score">
                                &nbsp;&nbsp;
                        </td>
                        <td>
                                &nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
        <td class="comment-text">
            <div style="display: block;" class="comment-body">
                <span class="comment-copy">You're right.  Just draw the filled rect first and then the stroke around the outside.</span>
                –&nbsp;
                    <a href="http://stackoverflow.com/users/1161878/gene" title="22814 reputation" class="comment-user">Gene</a>
                <span class="comment-date" dir="ltr"><a class="comment-link" href="#comment18551804_13545792"><span title="2012-11-24 21:31:04Z" class="relativetime-clean">Nov 24 '12 at 21:31</span></a></span>
                                                                            </div>
                    </td>
    </tr>
                </tbody>
		    </table>
	    </div>

        <div id="comments-link-13545792" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="#" onclick=""></a>
        </div>         
    </td>
</tr>        </tbody></table>
</div>

			<div id="answers">

				<a name="tab-top"></a>
				<div id="answers-header">
					<div class="subheader answers-subheader">
						<h2>
								2 Answers
                                <span style="display:none;" itemprop="answerCount">2</span>
						</h2>
						<div>
							<div id="tabs">
        <a href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
        <a href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
        <a class="youarehere" href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>
</div>
						</div>
					</div>    
				</div>    




  
<a name="13545816"></a>
<div id="answer-13545816" class="answer accepted-answer" data-answerid="13545816" itemscope="" itemtype="http://schema.org/Answer" itemprop="acceptedAnswer">
    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input name="_id_" value="13545816" type="hidden">
    <a class="vote-up-off" title="This answer is useful">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">3</span>
    <a class="vote-down-off" title="This answer is not useful">down vote</a>
    


        <span class="vote-accepted-on load-accepted-answer-date" title="loading when this answer was accepted...">accepted</span>
</div>

            </td>
            


<td class="answercell">
    <div class="post-text" itemprop="text">
<p>You draw a rectangle with the color of the border and the size of the
 rectangle plus the border, you change the color of the paint and draw 
again the rectangle with the normal size.</p>
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/a/13545816" title="short permalink to this answer" class="short-link" id="link-post-13545816">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/13545816/edit" class="suggest-edit-post" title="">improve this answer</a></div>                    </td>
            


    <td class="post-signature" align="right">   
       

    <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2012-11-24 21:32:04Z" class="relativetime">Nov 24 '12 at 21:32</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/1613578/ydelouis"><div class="gravatar-wrapper-32"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/6b413ef764d2fbbb28be50ea02db05d6.jpg" alt="" height="32" width="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/1613578/ydelouis">yDelouis</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">1,647</span><span title="8 silver badges"><span class="badge2"></span><span class="badgecount">8</span></span><span title="13 bronze badges"><span class="badge3"></span><span class="badgecount">13</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</td>
        </tr>
        
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-13545816" class="comments ">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">



    <tr id="comment-42129644" class="comment ">
        <td>
            <table>
                <tbody>
                    <tr>
                        <td class=" comment-score">
                                &nbsp;&nbsp;
                        </td>
                        <td>
                                &nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
        <td class="comment-text">
            <div style="display: block;" class="comment-body">
                <span class="comment-copy">Note that this results in a drawing the same area almost twice</span>
                –&nbsp;
                    <a href="http://stackoverflow.com/users/517450/radu-simionescu" title="903 reputation" class="comment-user">Radu Simionescu</a>
                <span class="comment-date" dir="ltr"><a class="comment-link" href="#comment42129644_13545816"><span title="2014-11-06 09:09:14Z" class="relativetime-clean">Nov 6 '14 at 9:09</span></a></span>
                                                                            </div>
                    </td>
    </tr>
                </tbody>
		    </table>
	    </div>

        <div id="comments-link-13545816" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="#" onclick=""></a>
        </div>         
    </td>
</tr>    </tbody></table>
</div>
<script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk1650479985",4).setZone(44) ; });                    
            </script>
            <div class="everyonelovesstackoverflow adzerk-vote" id="adzerk1650479985"><a href="http://engine.adzerk.net/r?e=eyJhdiI6NDE0LCJhdCI6NCwiYnQiOjAsImNtIjoxODY2MjQsImNoIjoxMTc4LCJjciI6Njk1NzM3LCJkaSI6ImVkYjlkODg5ZjVmMTQ1YzViYjIxZTgxYzc1NDJhZTAxIiwiZG0iOjEsImZjIjo3MjE4MzEsImZsIjo0MzE3ODAsImlwIjoiMTQuMTY5LjQ0LjEiLCJrdyI6ImFuZHJvaWQsYm9yZGVyLGFuZHJvaWQtY2FudmFzLHBhaW50LGZpbGwiLCJudyI6MjIsInBjIjowLCJwciI6MTYwNCwicnQiOjEsInJmIjoiaHR0cDovL3d3dy5nb29nbGUuY29tL3VybD9zYT10JnJjdD1qJnE9JmVzcmM9cyZzb3VyY2U9d2ViJmNkPTImdmVkPTBDQ1VRRmpBQiZ1cmw9aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucy8xMzU0NTc5Mi9kcmF3aW5nLWEtZmlsbGVkLXJlY3RhbmdsZS13aXRoLWEtYm9yZGVyLWluLWFuZHJvaWQmZWk9d0xnQlZlam1FTXo1OFFYNjZvRG9EZyZ1c2c9QUZRakNOSHFZekVQeTcyd2VtZXJWRFJ1NW81N3ZHb09hQSZidm09YnYuODc5MjA3MjYsZC5kR2MmY2FkPXJqYSIsInN0Ijo4Mjc3LCJ1ayI6InVlMS00MzRhZTZkMmZmZGI0NDkzYmQ2ZTUzNWQ4Y2ZlODgxMCIsInpuIjo0NCwidHMiOjE0MjYxNzYxOTc0OTMsImJmIjp0cnVlLCJwbiI6ImFkemVyazE2NTA0Nzk5ODUiLCJ1ciI6Imh0dHA6Ly9jYXJlZXJzLnN0YWNrb3ZlcmZsb3cuY29tL2pvYnMvcmVtb3RlP3V0bV9zb3VyY2U9c3RhY2tvdmVyZmxvdy5jb20mdXRtX21lZGl1bT1hZCZ1dG1fY2FtcGFpZ249Y2FuZGlkYXRlcy13ZmgmdXRtX2NvbnRlbnQ9bGItd2ZoLWFueXdoZXJlfiJ9&amp;s=gGLdFSbQLSxd_C94EA4pMvGzUZE" rel="nofollow" target="_blank" title=""><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/ed3b3bbfd4364176bfd1feb8506577ed.jpg" title="" alt="" border="0" height="90" width="728"></a><div class="adzerk-vote-controls" style="display: none;"><div class="adzerk-vote-option adzerk-vote-up"><div class="adzerk-vote-icon"></div></div><div class="adzerk-vote-option adzerk-vote-down"><div class="adzerk-vote-icon"></div></div></div><div class="adzerk-vote-survey" style="display:none;"><form><span>No problem. We won't show you that ad again. Why didn't you like it?</span><ul><li><label><input value="12" name="downvoteReason" type="radio">Uninteresting</label></li><li><label><input value="13" name="downvoteReason" type="radio">Misleading</label></li><li><label><input value="14" name="downvoteReason" type="radio">Offensive</label></li><li><label><input value="15" name="downvoteReason" type="radio">Repetitive</label></li><li><label><input value="16" name="downvoteReason" type="radio">Other</label></li></ul><a href="#" class="adzerk-vote-cancel">Oops! I didn't mean to do this.</a></form></div><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/i_004.gif" style="position:absolute;" border="0" height="0px" width="0px"></div>
  
<a name="18417222"></a>
<div id="answer-18417222" class="answer" data-answerid="18417222" itemscope="" itemtype="http://schema.org/Answer">
    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input name="_id_" value="18417222" type="hidden">
    <a class="vote-up-off" title="This answer is useful">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">19</span>
    <a class="vote-down-off" title="This answer is not useful">down vote</a>
    


</div>

            </td>
            


<td class="answercell">
    <div class="post-text" itemprop="text">
<p>Try paint.<strong>setStyle</strong>(Paint.Style.<strong>FILL</strong>) and paint.<strong>setStyle</strong>(Paint.Style.<strong>STROKE</strong>).</p>

<pre style="" class="default prettyprint prettyprinted"><code><span class="typ">Paint</span><span class="pln"> paint </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Paint</span><span class="pun">();</span><span class="pln">
</span><span class="typ">Rect</span><span class="pln"> r </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Rect</span><span class="pun">(</span><span class="lit">10</span><span class="pun">,</span><span class="pln"> </span><span class="lit">10</span><span class="pun">,</span><span class="pln"> </span><span class="lit">200</span><span class="pun">,</span><span class="pln"> </span><span class="lit">100</span><span class="pun">);</span><span class="pln">

</span><span class="lit">@Override</span><span class="pln">
</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> onDraw</span><span class="pun">(</span><span class="typ">Canvas</span><span class="pln"> canvas</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
    </span><span class="com">// fill</span><span class="pln">
    paint</span><span class="pun">.</span><span class="pln">setStyle</span><span class="pun">(</span><span class="typ">Paint</span><span class="pun">.</span><span class="typ">Style</span><span class="pun">.</span><span class="pln">FILL</span><span class="pun">);</span><span class="pln">
    paint</span><span class="pun">.</span><span class="pln">setColor</span><span class="pun">(</span><span class="typ">Color</span><span class="pun">.</span><span class="pln">MAGENTA</span><span class="pun">);</span><span class="pln"> 
    canvas</span><span class="pun">.</span><span class="pln">drawRect</span><span class="pun">(</span><span class="pln">r</span><span class="pun">,</span><span class="pln"> paint</span><span class="pun">);</span><span class="pln">

    </span><span class="com">// border</span><span class="pln">
    paint</span><span class="pun">.</span><span class="pln">setStyle</span><span class="pun">(</span><span class="typ">Paint</span><span class="pun">.</span><span class="typ">Style</span><span class="pun">.</span><span class="pln">STROKE</span><span class="pun">);</span><span class="pln">
    paint</span><span class="pun">.</span><span class="pln">setColor</span><span class="pun">(</span><span class="typ">Color</span><span class="pun">.</span><span class="pln">BLACK</span><span class="pun">);</span><span class="pln">
    canvas</span><span class="pun">.</span><span class="pln">drawRect</span><span class="pun">(</span><span class="pln">r</span><span class="pun">,</span><span class="pln"> paint</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span></code></pre>
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/a/18417222" title="short permalink to this answer" class="short-link" id="link-post-18417222">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/18417222/edit" class="suggest-edit-post" title="">improve this answer</a></div>                    </td>
    <td class="post-signature" align="right">
<div class="user-info ">
    <div class="user-action-time">
        <a href="http://stackoverflow.com/posts/18417222/revisions" title="show all edits to this post">edited <span title="2013-08-24 22:27:09Z" class="relativetime">Aug 24 '13 at 22:27</span></a>
    </div>
    <div class="user-gravatar32">
        
    </div>
    <div class="user-details">
        <br>
        
    </div>
</div>    </td>
            


    <td class="post-signature" align="right">   
       

    <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2013-08-24 09:51:26Z" class="relativetime">Aug 24 '13 at 9:51</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/639616/wannik"><div class="gravatar-wrapper-32"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/ac3aefcc70deca71f79d85d967740c56.png" alt="" height="32" width="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/639616/wannik">wannik</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">3,384</span><span title="4 gold badges"><span class="badge1"></span><span class="badgecount">4</span></span><span title="12 silver badges"><span class="badge2"></span><span class="badgecount">12</span></span><span title="29 bronze badges"><span class="badge3"></span><span class="badgecount">29</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</td>
        </tr>
        
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-18417222" class="comments ">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">



    <tr id="comment-29463806" class="comment ">
        <td>
            <table>
                <tbody>
                    <tr>
                        <td class=" comment-score">
                                &nbsp;&nbsp;
                        </td>
                        <td>
                                &nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
        <td class="comment-text">
            <div style="display: block;" class="comment-body">
                <span class="comment-copy">Is there also a way to do 
this for canvas.drawRoundRect()? Because in my case, the border has now 
rounded corners, even though I draw it also with canvas.drawRoundRect().</span>
                –&nbsp;
                    <a href="http://stackoverflow.com/users/1332314/chris" title="104 reputation" class="comment-user">Chris</a>
                <span class="comment-date" dir="ltr"><a class="comment-link" href="#comment29463806_18417222"><span title="2013-11-06 16:05:43Z" class="relativetime-clean">Nov 6 '13 at 16:05</span></a></span>
                                                                            </div>
                    </td>
    </tr>
                </tbody>
		    </table>
	    </div>

        <div id="comments-link-18417222" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="#" onclick=""></a>
        </div>         
    </td>
</tr>    </tbody></table>
</div>
									<a name="new-answer"></a>
						<form id="post-form" action="/questions/13545792/answer/submit" method="post" class="post-form">
						    <input id="post-id" value="13545792" type="hidden">
                            <input id="qualityBanWarningShown" name="qualityBanWarningShown" value="false" type="hidden">
                            <input name="referrer" value="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=2&amp;ved=0CCUQFjAB&amp;url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F13545792%2Fdrawing-a-filled-rectangle-with-a-border-in-android&amp;ei=wLgBVejmEMz58QX66oDoDg&amp;usg=AFQjCNHqYzEPy72wemerVDRu5o57vGoOaA&amp;bvm=bv.87920726,d.dGc&amp;cad=rja" type="hidden">
							<h2 class="space">Your Answer</h2>



            <script>
            StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                    StackExchange.using("snippets", function () {
                        StackExchange.snippets.init();
                    });
                });
            }, "code-snippets");
        </script>
    

<script>
    StackExchange.ready(function() {
        initTagRenderer("".split(" "), "".split(" "));
       
        StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.options.snippets.enabled) {
                StackExchange.using("snippets", function() {
                    createEditor();
                });
            }
            else {
                createEditor();
            }
        });

        function createEditor() {
            prepareEditor({
                heartbeatType: 'answer',
                bindNavPrevention: true,
                postfix: "",
                    onDemand: true,
                    discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });
                

        }
    });  
</script>


<div id="post-editor" class="post-editor">

    <div style="position: relative;">     
        <div class="wmd-container">
            <div id="wmd-button-bar" class="wmd-button-bar"><ul id="wmd-button-row" class="wmd-button-row"><li style="left: 0px;" class="wmd-button" id="wmd-bold-button"><span style="background-position: 0px -20px;"></span></li><li style="left: 25px;" class="wmd-button" id="wmd-italic-button"><span style="background-position: -20px -20px;"></span></li><li style="left: 50px;" class="wmd-spacer" id="wmd-spacer1"><span style="background-position: -40px -20px;"></span></li><li style="left: 75px;" class="wmd-button" id="wmd-link-button"><span style="background-position: -40px -20px;"></span></li><li style="left: 100px;" class="wmd-button" id="wmd-quote-button"><span style="background-position: -60px -20px;"></span></li><li style="left: 125px;" class="wmd-button" id="wmd-code-button"><span style="background-position: -80px -20px;"></span></li><li style="left: 150px;" class="wmd-button" id="wmd-image-button"><span style="background-position: -100px -20px;"></span></li><li style="left: 175px;" class="wmd-spacer" id="wmd-spacer2"><span style="background-position: -120px -20px;"></span></li><li style="left: 200px;" class="wmd-button" id="wmd-olist-button"><span style="background-position: -120px -20px;"></span></li><li style="left: 225px;" class="wmd-button" id="wmd-ulist-button"><span style="background-position: -140px -20px;"></span></li><li style="left: 250px;" class="wmd-button" id="wmd-heading-button"><span style="background-position: -160px -20px;"></span></li><li style="left: 275px;" class="wmd-button" id="wmd-hr-button"><span style="background-position: -180px -20px;"></span></li><li style="left: 300px;" class="wmd-spacer" id="wmd-spacer3"><span style="background-position: -200px -20px;"></span></li><li style="left: 325px;" class="wmd-button" id="wmd-undo-button"><span style="background-position: -200px -20px;"></span></li><li style="left: 350px;" class="wmd-button" id="wmd-redo-button"><span style="background-position: -220px -20px;"></span></li></ul></div>
            <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
        </div>
    </div>

    <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
    <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>

    <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>



    <div id="wmd-preview" class="wmd-preview"></div>
    <div></div>
    <div class="edit-block">
        <input id="fkey" name="fkey" value="7d79d500f57d16c8348b0cafce12f3e4" type="hidden">
        <input id="author" name="author" type="text">
    </div>



</div>
							<div style="position: relative;">
								
            <div class="form-item new-post-login">
        
                <div class="new-login-form">
                    <div class="new-login-left">
                        <h3>Sign up or <a id="login-link" href="http://stackoverflow.com/users/login?returnurl=%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android%23new-answer">log in</a></h3>
                        <script>
                            StackExchange.ready(function () {
                                StackExchange.helpers.onClickDraftSave('#login-link');
                            });
                        </script>
                        <div class="preferred-login google-login">
                            <p><span class="icon"></span><span>Sign up using Google</span></p>
                        </div>
                        <div class="preferred-login facebook-login">
                            <p><span class="icon"></span><span>Sign up using Facebook</span></p>
                        </div>
                        <div class="preferred-login stackexchange-login">
                            <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
                        </div>
                    </div>
                    <input name="manual-openid" class="manual-openid" type="hidden">
                    <input name="use-facebook" class="use-facebook" value="false" type="hidden">
                    <input name="use-google" class="use-google" value="false" type="hidden">
                    <input class="submit-openid" value="Submit" style="display:none" type="button">
                    <div class="new-login-right">
                                <h3>Post as a guest</h3>
    <div class="form-item">
        <table>
        <tbody><tr>
                    <td class="vm">
                <div>
                    <label for="display-name">Name</label>
                    <input id="display-name" name="display-name" size="30" maxlength="30" tabindex="105" type="text">
                </div>
                <div>
                    <label for="m-address">Email</label>
                    <input id="m-address" name="m-address" size="30" maxlength="100" tabindex="106" placeholder="required, but never shown" type="email">
                </div>
            </td>
        </tr>
        </tbody></table>
    </div>

                    </div>
                </div>
            </div>
            <script>
                StackExchange.ready(
                    function () {
                        StackExchange.openid.initPostLogin('.new-post-login', '%2fquestions%2f13545792%2fdrawing-a-filled-rectangle-with-a-border-in-android%23new-answer');
                    }
                );
            </script>
            <noscript>
                        <h3>Post as a guest</h3>
    <div class="form-item">
        <table>
        <tr>
                    <td class="vm">
                <div>
                    <label for="display-name">Name</label>
                    <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                </div>
                <div>
                    <label for="m-address">Email</label>
                    <input id="m-address" name="m-address" type="email" size="30" maxlength="100" value="" tabindex="106" placeholder="required, but never shown" />
                </div>
            </td>
        </tr>
        </table>
    </div>

            </noscript>
							</div>
           
															<div class="form-submit cbt">
									<input id="submit-button" value="Post Your Answer" tabindex="110" type="submit">
									<a href="#" class="discard-answer dno">discard</a>

<p class="privacy-policy-agreement">
By posting your answer, you agree to the <a href="http://stackexchange.com/legal/privacy-policy" target="_blank">privacy policy</a> and <a href="http://stackexchange.com/legal/terms-of-service" target="_blank">terms of service</a>.</p>
<input name="legalLinksShown" value="1" type="hidden">								</div>
						</form>



						<h2 class="bottom-notice" data-loc="1">
Not the answer you're looking for?							Browse other questions tagged <a href="http://stackoverflow.com/questions/tagged/android" class="post-tag" title="show questions tagged 'android'" rel="tag"><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/tKsDb.png" alt="" class="sponsor-tag-img" height="16" width="18">android</a> <a href="http://stackoverflow.com/questions/tagged/border" class="post-tag" title="show questions tagged 'border'" rel="tag">border</a> <a href="http://stackoverflow.com/questions/tagged/android-canvas" class="post-tag" title="show questions tagged 'android-canvas'" rel="tag">android-canvas</a> <a href="http://stackoverflow.com/questions/tagged/paint" class="post-tag" title="show questions tagged 'paint'" rel="tag">paint</a> <a href="http://stackoverflow.com/questions/tagged/fill" class="post-tag" title="show questions tagged 'fill'" rel="tag">fill</a>  or <a href="http://stackoverflow.com/questions/ask">ask your own question</a>.						</h2>
			</div>
		</div>
				<div id="sidebar" class="show-votes">
						    <div class="module question-stats">
			        <table id="qinfo">
			            <tbody><tr>
			                <td>
			                    <p class="label-key">asked</p>
			                </td>
			                <td style="padding-left: 10px">
			                    <p class="label-key" title="2012-11-24 21:28:47Z"><b>2 years ago</b></p>
			                </td>
			            </tr>
			            <tr>
			                <td>
			                    <p class="label-key">viewed</p>
			                </td>

			                <td style="padding-left: 10px">
			                    <p class="label-key">
			                        <b>13307 times</b>
			                    </p>
			                </td>
			            </tr>
			                <tr>
			                    <td>
			                        <p class="label-key">active</p>
			                    </td>
			                    <td style="padding-left: 10px">
			                        <p class="label-key"><b><a href="http://stackoverflow.com/questions/13545792/drawing-a-filled-rectangle-with-a-border-in-android?lastactivity" class="lastactivity-link" title="2013-08-24 22:27:09Z">1 year ago</a></b></p>
			                    </td>
			                </tr>
			        </tbody></table>
			    </div>
						
			<script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk894215028",[17,2221]).setZone(45) ; });                    
            </script>
            <div class="everyonelovesstackoverflow adzerk-vote" id="adzerk894215028"><a href="http://engine.adzerk.net/r?e=eyJhdiI6NDE0LCJhdCI6MTcsImJ0IjowLCJjbSI6MTg2NjI0LCJjaCI6MTE3OCwiY3IiOjY5NTU1NiwiZGkiOiI2MmZhYWZhMmQzOTY0OGZjYjZiODk1YTVhOWJjNGFkMSIsImRtIjoxLCJmYyI6NzIxNTg2LCJmbCI6NDQxMzM0LCJpcCI6IjE0LjE2OS40NC4xIiwia3ciOiJhbmRyb2lkLGJvcmRlcixhbmRyb2lkLWNhbnZhcyxwYWludCxmaWxsIiwibnciOjIyLCJwYyI6MCwicHIiOjE1NjgsInJ0IjoxLCJyZiI6Imh0dHA6Ly93d3cuZ29vZ2xlLmNvbS91cmw_c2E9dCZyY3Q9aiZxPSZlc3JjPXMmc291cmNlPXdlYiZjZD0yJnZlZD0wQ0NVUUZqQUImdXJsPWh0dHA6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMTM1NDU3OTIvZHJhd2luZy1hLWZpbGxlZC1yZWN0YW5nbGUtd2l0aC1hLWJvcmRlci1pbi1hbmRyb2lkJmVpPXdMZ0JWZWptRU16NThRWDY2b0RvRGcmdXNnPUFGUWpDTkhxWXpFUHk3MndlbWVyVkRSdTVvNTd2R29PYUEmYnZtPWJ2Ljg3OTIwNzI2LGQuZEdjJmNhZD1yamEiLCJzdCI6ODI3NywidWsiOiJ1ZTEtNDM0YWU2ZDJmZmRiNDQ5M2JkNmU1MzVkOGNmZTg4MTAiLCJ6biI6NDUsInRzIjoxNDI2MTc2MTk3NDk4LCJiZiI6dHJ1ZSwicG4iOiJhZHplcms4OTQyMTUwMjgiLCJ1ciI6Imh0dHA6Ly9jYXJlZXJzLnN0YWNrb3ZlcmZsb3cuY29tL2N2L2dldC1vbmU_dXRtX3NvdXJjZT1zdGFja292ZXJmbG93LmNvbSZ1dG1fbWVkaXVtPWFkJnV0bV9jYW1wYWlnbj1jYW5kaWRhdGVzLWFkZC1jdiZ1dG1fY29udGVudD1zYi1sYXVuY2gteW91cnNlbGYifQ&amp;s=qsNsTvl8FyvKtq9xn35-Diybyrg" rel="nofollow" target="_blank" title=""><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/578f2ad4eed04a95b0fe312bd237c11c.png" title="" alt="" border="0" height="250" width="220"></a><div class="adzerk-vote-controls" style="display:none;"><div class="adzerk-vote-option adzerk-vote-up"><div class="adzerk-vote-icon"></div></div><div class="adzerk-vote-option adzerk-vote-down"><div class="adzerk-vote-icon"></div></div></div><div class="adzerk-vote-survey" style="display:none;"><form><span>No problem. We won't show you that ad again. Why didn't you like it?</span><ul><li><label><input value="12" name="downvoteReason" type="radio">Uninteresting</label></li><li><label><input value="13" name="downvoteReason" type="radio">Misleading</label></li><li><label><input value="14" name="downvoteReason" type="radio">Offensive</label></li><li><label><input value="15" name="downvoteReason" type="radio">Repetitive</label></li><li><label><input value="16" name="downvoteReason" type="radio">Other</label></li></ul><a href="#" class="adzerk-vote-cancel">Oops! I didn't mean to do this.</a></form></div><img src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/i_002.gif" style="position:absolute;" border="0" height="0px" width="0px"></div>  
        <div class="orange looking tagged" id="hireme"><a href="http://careers.stackoverflow.com/jobs?a=2LRza" target="_blank" data-la="2LRza" data-hf="h" class="top"> <span>Looking for a job?</span></a><ul class="jobs"><li><a data-cid="166950" data-la="r2JOmu4s3EB" href="http://careers.stackoverflow.com/jobs/80640/senior-product-manager-woot-ordering-and-amazon" target="_blank" title="Senior Product Manager, Woot Ordering and Fulfillment at Amazon. Click to learn more.">Senior Product Manager, Woot Ordering and Fulfillment<br><div class="company">Amazon</div><div class="location" title="Seattle, WA / relocation">Seattle, WA / relocation</div><span class="post-tag">e-commerce</span><span class="post-tag">model</span></a></li><li><a data-cid="169064" data-la="rL4itnHdY1I" href="http://careers.stackoverflow.com/jobs/82772/senior-android-developer-truecaller" target="_blank" title="Senior Android Developer at Truecaller. Click to learn more.">Senior Android Developer<br><div class="company">Truecaller</div><div class="location" title="Stockholm, Sweden / relocation">Stockholm, Sweden / relocation</div><span class="post-tag">android</span><span class="post-tag">java</span></a></li></ul><img class="impression" src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/i.gif" style="display:none;"><img class="impression" src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/r2JOmu4s3EB-rL4itnHdY1I-2LRza.gif" style="display:none;"></div>
			  
    
            

				<div class="module sidebar-related">
					<h4 id="h-related">Related</h4>
                    <div class="related js-gps-related-questions" data-tracker="rq=1">
                        <div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/7344497?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">50
    </div>
</a><a href="http://stackoverflow.com/questions/7344497/android-canvas-draw-rectangle?rq=1" class="question-hyperlink">Android canvas draw rectangle</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/8515458?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">0
    </div>
</a><a href="http://stackoverflow.com/questions/8515458/why-do-we-need-paint-to-draw-an-integer-array-of-colors-as-a-bitmap-in-android?rq=1" class="question-hyperlink">Why do we need Paint to draw an integer array of colors as a bitmap in android?</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/9629299?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">2
    </div>
</a><a href="http://stackoverflow.com/questions/9629299/android-how-to-fill-color-to-the-specific-part-of-the-image-only?rq=1" class="question-hyperlink">Android: How to fill color to the specific part of the Image only?</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/10989120?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">4
    </div>
</a><a href="http://stackoverflow.com/questions/10989120/strange-crash-drawing-on-canvas-on-android-4-0-3-a-libc-fatal-signal-11-sigse?rq=1" class="question-hyperlink">Strange crash drawing on canvas on Android 4.0.3. A/libc: Fatal signal 11 (SIGSEGV)</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/11253344?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">1
    </div>
</a><a href="http://stackoverflow.com/questions/11253344/how-do-i-make-a-pattern-fill-of-the-path-of-a-text-in-android?rq=1" class="question-hyperlink">How do I make a pattern fill of the path of a text in android?</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/17967176?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">0
    </div>
</a><a href="http://stackoverflow.com/questions/17967176/change-color-in-drawing-view-android?rq=1" class="question-hyperlink">Change color in drawing view android</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/18934875?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">2
    </div>
</a><a href="http://stackoverflow.com/questions/18934875/android-canvas-fill-background-color-canvas-application?rq=1" class="question-hyperlink">Android canvas fill background color (Canvas application)</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/20144788?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">3
    </div>
</a><a href="http://stackoverflow.com/questions/20144788/fill-pattern-in-image-in-android?rq=1" class="question-hyperlink">Fill pattern in Image in Android</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/21055809?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">1
    </div>
</a><a href="http://stackoverflow.com/questions/21055809/how-to-draw-curves-and-straight-lines-in-one-image?rq=1" class="question-hyperlink">How to draw curves and straight lines in one image?</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/27694649?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">2
    </div>
</a><a href="http://stackoverflow.com/questions/27694649/draw-rainbow-paint-on-canvas-android?rq=1" class="question-hyperlink">Draw Rainbow Paint on canvas android</a>
</div>

                    </div>
				</div>
            
<div id="hot-network-questions" class="module">
    <h4>
        <a href="http://stackexchange.com/questions?tab=hot" class="js-gps-track" data-gps-track="posts_hot_network.click({ item_type:1, location:11 })">
            Hot Network Questions
        </a>
    </h4>
    <ul>
            <li>
                <div class="favicon favicon-japanese" title="Japanese Language Stack Exchange"></div><a href="http://japanese.stackexchange.com/questions/23212/connecting-adjectives-does-not-have-to-a-and-b" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:257 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Connecting adjectives, "does not have to A and B"
                </a>

            </li>
            <li>
                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/27046/kind-of-soft-link-of-objects-between-scenes" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Kind of "soft link" of objects between scenes?
                </a>

            </li>
            <li>
                <div class="favicon favicon-puzzling" title="Puzzling Stack Exchange"></div><a href="http://puzzling.stackexchange.com/questions/10100/all-through-the-seasons-what-am-i" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })">
                    All through the Seasons - What am I?
                </a>

            </li>
            <li>
                <div class="favicon favicon-math" title="Mathematics Stack Exchange"></div><a href="http://math.stackexchange.com/questions/1186912/2005-putnam-b1-find-a-polynomial" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:69 }); posts_hot_network.click({ item_type:2, location:11 })">
                    2005 Putnam B1: Find a Polynomial
                </a>

            </li>
            <li>
                <div class="favicon favicon-ux" title="User Experience Stack Exchange"></div><a href="http://ux.stackexchange.com/questions/74777/should-email-address-be-allowed-to-be-non-unique" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:102 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Should email address be allowed to be non-unique?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-unix" title="Unix &amp; Linux Stack Exchange"></div><a href="http://unix.stackexchange.com/questions/189688/monitor-linux-file-systems-using-df" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:106 }); posts_hot_network.click({ item_type:2, location:11 })">
                    monitor linux file systems using df
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/232638/what-is-cervantex" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What is Cervantex?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-scifi" title="Science Fiction &amp; Fantasy Stack Exchange"></div><a href="http://scifi.stackexchange.com/questions/83635/could-the-bifrost-bridge-be-used-to-extract-someone-from-a-secure-location" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Could the Bifrost Bridge be used to "extract" someone from a secure location?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/29003798/how-to-implement-11-3-in-ruby" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                    how to implement 1+1=3 in Ruby
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-rpg" title="Role-playing Games Stack Exchange"></div><a href="http://rpg.stackexchange.com/questions/57900/damage-type-of-quarterstaff-thrusts" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:122 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Damage type of quarterstaff thrusts
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-vi" title="Vi and Vim Stack Exchange"></div><a href="http://vi.stackexchange.com/questions/2505/youcompleteme-in-non-code-files-yields-user-defined-completion-unp-patte" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:599 }); posts_hot_network.click({ item_type:2, location:11 })">
                    YouCompleteMe in non-code files yields -- User defined completion (^U^N^P) Pattern not found
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-academia" title="Academia Stack Exchange"></div><a href="http://academia.stackexchange.com/questions/41427/does-wearing-a-university-t-shirt-imply-that-the-wearer-is-affiliated-with-the-u" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:415 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Does wearing a university t-shirt imply that the wearer is affiliated with the university?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-codegolf" title="Programming Puzzles &amp; Code Golf Stack Exchange"></div><a href="http://codegolf.stackexchange.com/questions/47644/randomised-list-formatted-nicely" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:200 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Randomised list, formatted nicely
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-parenting" title="Parenting Stack Exchange"></div><a href="http://parenting.stackexchange.com/questions/19003/is-there-any-way-to-limit-distress-when-diaper-changing-for-newborns" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:228 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is there any way to limit distress when diaper changing for newborns?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-drupal" title="Drupal Answers"></div><a href="http://drupal.stackexchange.com/questions/151358/how-can-i-give-alphabets-only-validation-in-webform" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:220 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How can i give alphabets only validation in webform?
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-dba" title="Database Administrators Stack Exchange"></div><a href="http://dba.stackexchange.com/questions/95057/sql-server-standard-edition-attach-partitioned-database" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:182 }); posts_hot_network.click({ item_type:2, location:11 })">
                    SQL Server Standard edition attach partitioned database
                </a>

            </li>
            <li style="display: list-item;" class="dno js-hidden">
                <div class="favicon favicon-superuser" title="Super User"></div><a href="http://superuser.com/questions/887455/how-can-windows-dump-the-complete-ram-in-the-hibernation-file-so-fast" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:3 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How can Windows dump the complete RAM in the hibernation file so fast?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-electronics" title="Electrical Engineering Stack Exchange"></div><a href="http://electronics.stackexchange.com/questions/159343/how-often-should-i-query-a-rtc" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:135 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How often should I query a RTC?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-english" title="English Language &amp; Usage Stack Exchange"></div><a href="http://english.stackexchange.com/questions/232979/can-i-use-one-word-to-say-common-human-behaviour" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Can I use one word to say- 'common human behaviour'
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-aviation" title="Aviation Stack Exchange"></div><a href="http://aviation.stackexchange.com/questions/13132/why-do-planes-always-land-on-rear-wheels-instead-of-the-nose-wheels" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:528 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Why do planes always land on rear wheels instead of the nose wheels?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/232713/warning-using-typearea-a5-bcor-8mm-div-calc" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Warning, using: typearea, a5, BCOR=8mm, DIV=calc
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-academia" title="Academia Stack Exchange"></div><a href="http://academia.stackexchange.com/questions/41449/is-it-ethical-to-host-ads-on-institute-provided-homepage" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:415 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is it ethical to host ads on institute provided homepage?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-travel" title="Travel Stack Exchange"></div><a href="http://travel.stackexchange.com/questions/44510/is-there-a-site-that-shows-the-current-gps-position-of-active-cruise-ships" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:273 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is there a site that shows the current GPS position of active cruise ships?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-mathoverflow" title="MathOverflow"></div><a href="http://mathoverflow.net/questions/199767/choice-of-fibrations-is-like-a-choice-of-a-basis-of-a-module" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:504 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Choice of fibrations is like a choice of a basis of a module
                </a>

            </li>
    </ul>

        <a href="#" class="show-more js-show-more js-gps-track" data-gps-track="posts_hot_network.click({ item_type:3, location:11 })">
            more hot questions
        </a>
</div>
		</div>
	
<div id="feed-link">
    <div id="feed-link-text">
        <a href="http://stackoverflow.com/feeds/question/13545792" title="feed of this question and its answers">
            <span class="feed-icon"></span>question feed
        </a>
    </div>
</div>	<script>
StackExchange.ready(function(){$.get('/posts/13545792/ivc/422c');});
</script>
<noscript>
    <div><img src="/posts/13545792/ivc/422c" class="dno" alt="" width="0" height="0"></div>
</noscript><div style="display:none" id="prettify-lang">default</div></div>



        </div>
    </div>
    <div id="footer" class="categories">
        <div class="footerwrap">
            <div id="footer-menu">
                <div class="top-footer-links">
                        <a href="http://stackoverflow.com/tour">tour</a>
                    <a href="http://stackoverflow.com/help">help</a>
                    <a href="http://blog.stackoverflow.com/?blb=1">blog</a>
                        <a href="http://chat.stackoverflow.com/">chat</a>
                    <a href="http://data.stackexchange.com/">data</a>
                    <a href="http://stackexchange.com/legal">legal</a>
                    <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a>
                    <a href="http://stackexchange.com/work-here">work here</a>
                    <a href="http://stackexchange.com/mediakit">advertising info</a>

                    <a onclick='StackExchange.switchMobile("on")'>mobile</a>
                    <b><a href="http://stackoverflow.com/contact">contact us</a></b>
                        <b><a href="http://meta.stackoverflow.com/">feedback</a></b>
                    
                </div>
                <div id="footer-sites">
                    <table>
    <tbody><tr>
            <th colspan="3">
                Technology
            </th>
            <th>
                Life / Arts
            </th>
            <th>
                Culture / Recreation
            </th>
            <th>
                Science
            </th>
            <th>
                Other
            </th>
    </tr>
    <tr>
            <td>
                <ol>
                        <li><a href="http://stackoverflow.com/" title="professional and enthusiast programmers">Stack Overflow</a></li>
                        <li><a href="http://serverfault.com/" title="system and network administrators">Server Fault</a></li>
                        <li><a href="http://superuser.com/" title="computer enthusiasts and power users">Super User</a></li>
                        <li><a href="http://webapps.stackexchange.com/" title="power users of web applications">Web Applications</a></li>
                        <li><a href="http://askubuntu.com/" title="Ubuntu users and developers">Ask Ubuntu</a></li>
                        <li><a href="http://webmasters.stackexchange.com/" title="pro webmasters">Webmasters</a></li>
                        <li><a href="http://gamedev.stackexchange.com/" title="professional and independent game developers">Game Development</a></li>
                        <li><a href="http://tex.stackexchange.com/" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
                            </ol></td><td><ol>
                        <li><a href="http://programmers.stackexchange.com/" title="professional programmers interested in conceptual questions about software development">Programmers</a></li>
                        <li><a href="http://unix.stackexchange.com/" title="users of Linux, FreeBSD and other Un*x-like operating systems.">Unix &amp; Linux</a></li>
                        <li><a href="http://apple.stackexchange.com/" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
                        <li><a href="http://wordpress.stackexchange.com/" title="WordPress developers and administrators">WordPress Development</a></li>
                        <li><a href="http://gis.stackexchange.com/" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
                        <li><a href="http://electronics.stackexchange.com/" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
                        <li><a href="http://android.stackexchange.com/" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
                        <li><a href="http://security.stackexchange.com/" title="Information security professionals">Information Security</a></li>
                            </ol></td><td><ol>
                        <li><a href="http://dba.stackexchange.com/" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
                        <li><a href="http://drupal.stackexchange.com/" title="Drupal developers and administrators">Drupal Answers</a></li>
                        <li><a href="http://sharepoint.stackexchange.com/" title="SharePoint enthusiasts">SharePoint</a></li>
                        <li><a href="http://ux.stackexchange.com/" title="user experience researchers and experts">User Experience</a></li>
                        <li><a href="http://mathematica.stackexchange.com/" title="users of Mathematica">Mathematica</a></li>
                        <li><a href="http://salesforce.stackexchange.com/" title="Salesforce administrators, implementation experts, developers and anybody in-between">Salesforce</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#technology" class="more">
                                more (14)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://photo.stackexchange.com/" title="professional, enthusiast and amateur photographers">Photography</a></li>
                        <li><a href="http://scifi.stackexchange.com/" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
                        <li><a href="http://graphicdesign.stackexchange.com/" title="Graphic Design professionals, students, and enthusiasts">Graphic Design</a></li>
                        <li><a href="http://cooking.stackexchange.com/" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
                        <li><a href="http://diy.stackexchange.com/" title="contractors and serious DIYers">Home Improvement</a></li>
                        <li><a href="http://money.stackexchange.com/" title="people who want to be financially literate">Personal Finance &amp; Money</a></li>
                        <li><a href="http://academia.stackexchange.com/" title="academics and those enrolled in higher education">Academia</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#lifearts" class="more">
                                more (10)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://english.stackexchange.com/" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
                        <li><a href="http://skeptics.stackexchange.com/" title="scientific skepticism">Skeptics</a></li>
                        <li><a href="http://judaism.stackexchange.com/" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
                        <li><a href="http://travel.stackexchange.com/" title="road warriors and seasoned travelers">Travel</a></li>
                        <li><a href="http://christianity.stackexchange.com/" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
                        <li><a href="http://gaming.stackexchange.com/" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
                        <li><a href="http://bicycles.stackexchange.com/" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
                        <li><a href="http://rpg.stackexchange.com/" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#culturerecreation" class="more">
                                more (21)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://math.stackexchange.com/" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
                        <li><a href="http://stats.stackexchange.com/" title="people interested in statistics, machine learning, data analysis, data mining, and data visualization">Cross Validated (stats)</a></li>
                        <li><a href="http://cstheory.stackexchange.com/" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
                        <li><a href="http://physics.stackexchange.com/" title="active researchers, academics and students of physics">Physics</a></li>
                        <li><a href="http://mathoverflow.net/" title="professional mathematicians">MathOverflow</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#science" class="more">
                                more (7)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://stackapps.com/" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
                        <li><a href="http://meta.stackexchange.com/" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Exchange</a></li>
                        <li><a href="http://area51.stackexchange.com/" title="proposing new sites in the Stack Exchange network">Area 51</a></li>
                        <li><a href="http://careers.stackoverflow.com/">Stack Overflow Careers</a></li>
                    
                </ol>
            </td>
    </tr>
</tbody></table>
                </div>
            </div>

            <div id="copyright">
                site design / logo © 2015 stack exchange inc; user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc by-sa 3.0</a> 
                with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
            </div>
            <div id="svnrev">
                rev 2015.3.12.2382
            </div>
            
        </div>
    </div>
    <noscript>
        <div id="noscript-warning">Stack Overflow works best with JavaScript enabled<img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"></div>
    </noscript>
<script>var p = "http", d = "static"; if (document.location.protocol == "https:") { p += "s"; d = "engine"; } var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = p + "://" + d + ".adzerk.net/ados.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
<script>
    var ados = ados || {};
    ados.run = ados.run || [];
    ados.run.push(function () { ados_setKeywords('android,border,android-canvas,paint,fill');; ados_load(); });         
</script>

    <script>
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o),
            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
        ga('create', 'UA-5620270-1');        
        
        ga('set', 'dimension2', '|android|border|android-canvas|paint|fill|');         
        ga('send', 'pageview');
        var _qevents = _qevents || [],
            _comscore = _comscore || [];
        (function () {
            var ssl='https:'==document.location.protocol,
                s=document.getElementsByTagName('script')[0],
                qc=document.createElement('script');
            qc.async=true;
            qc.src=(ssl?'https://secure':'http://edge')+'.quantserve.com/quant.js';
            s.parentNode.insertBefore(qc, s);
            var sc=document.createElement('script');
            sc.async=true;
            sc.src=(ssl?'https://sb':'http://b') + '.scorecardresearch.com/beacon.js';
            s.parentNode.insertBefore(sc, s);
        })();
        _comscore.push({ c1: "2", c2: "17440561" });
        _qevents.push({ qacct: "p-c1rF4kxgLUzNc" });
    </script>        
    
    
<script src="Drawing%20a%20filled%20rectangle%20with%20a%20border%20in%20android_files/p" type="text/javascript"></script></body></html>